package com.example.jung_week5_sharedpereference;

import android.os.Bundle;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.PreferenceActivity;
import android.preference.Preference.OnPreferenceChangeListener;
import android.widget.Toast;

public class SettingActivity extends PreferenceActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.preferencescreen);
		
		ListPreference pref = (ListPreference) findPreference("list");
		OnPreferenceChangeListener listener = new OnPreferenceChangeListener() {
			
			@Override
			public boolean onPreferenceChange(Preference preference, Object newValue) {
				Toast.makeText(getApplicationContext(), "newValue : "+newValue, 0).show();
				return false;
			}
		};
		pref.setOnPreferenceChangeListener(listener);
	}
	
}
